var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
    })(t, e);
}, function(t, e) {
    function n() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, 
    new n());
}), a = this && this.__decorate || function(t, e, o, n) {
    var i, r = arguments.length, c = r < 3 ? e : null === n ? n = Object.getOwnPropertyDescriptor(e, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(t, e, o, n); else for (var a = t.length - 1; 0 <= a; a--) (i = t[a]) && (c = (r < 3 ? i(c) : 3 < r ? i(e, o, c) : i(e, o)) || c);
    return 3 < r && c && Object.defineProperty(e, o, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("AudioManager"), s = e("LoadManager"), c = e("Global"), l = e("PopView"), d = cc._decorator, u = d.ccclass, p = d.property, h = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.light = null, t.sprite = null, t.rankLabel = null, t.nameLabel = null, 
        t.leftSprite = null, t.rightSprite = null, t.skeleton = null, t.combine = null, 
        t.box = null, t.btns = null, t.origin = 1, t;
    }
    return i(t, e), t.prototype.onLoad = function() {
        var t = cc.winSize;
        t.width > t.height ? this.origin = 1 : this.origin = 2, this.node.scale = this.origin;
    }, t.prototype.onEnable = function() {
        cc.tween(this.node).to(.1, {
            scale: 1.1 * this.origin
        }).to(.1, {
            scale: this.origin
        }).call(function() {}).start();
    }, t.prototype.onClick = function() {
        this.callback();
    }, t.prototype.start = function() {
        this.init();
    }, t.prototype.init = function() {
        cc.tween(this.light).repeatForever(cc.tween().by(2, {
            angle: 60
        })).start(), PD.checkObjParam("item", "rank", "number") && (this.rankLabel.string = (PD.data.item.rank + 1).toString(), 
        this.nameLabel.string = "黄金加特林", s.default.getInstance().loadSpriteFrame({
            url: "image/arm3/1",
            sprite: this.sprite
        }), this.doEffect());
    }, t.prototype.doEffect = function() {
        var e = this;
        PD.checkObjParam("item", "rank", "number") && s.default.getInstance().loadRes({
            url: "image/arm/" + c.G.getIdxByRank(PD.data.item.rank - 1),
            type: cc.SpriteFrame,
            success: function(t) {
                e.leftSprite.spriteFrame = t, e.rightSprite.spriteFrame = t, e.leftSprite.node.x = -250, 
                e.rightSprite.node.x = 250, r.default.getInstance().playAudio("高级合成时带闪电的那个"), e.skeleton.setAnimation(0, "animation", !1), 
                e.skeleton.setCompleteListener(function() {
                    e.skeleton.node.active = !1;
                }), e.scheduleOnce(function() {
                    cc.tween(e.leftSprite.node).by(.25, {
                        position: cc.v2(250, 0)
                    }).start(), cc.tween(e.rightSprite.node).by(.25, {
                        position: cc.v2(-250, 0)
                    }).start(), e.scheduleOnce(function() {
                        r.default.getInstance().playAudio("合成音效1", 2), e.leftSprite.node.active = !1, e.rightSprite.node.active = !1, 
                        e.box.active = !0, e.btns.active = !0, e.combine.node.active = !0, e.combine.setAnimation(0, "animation", !1), 
                        e.combine.setCompleteListener(function() {
                            e.combine.node.active = !1;
                        });
                    }, .25);
                }, .5);
            }
        });
    }, t.prototype.callback = function() {
        window.playableSDK.openAppStore(), console.log("open app store");
    }, a([ p(cc.Node) ], t.prototype, "light", void 0), a([ p(cc.Sprite) ], t.prototype, "sprite", void 0), 
    a([ p(cc.Label) ], t.prototype, "rankLabel", void 0), a([ p(cc.Label) ], t.prototype, "nameLabel", void 0), 
    a([ p(cc.Sprite) ], t.prototype, "leftSprite", void 0), a([ p(cc.Sprite) ], t.prototype, "rightSprite", void 0), 
    a([ p(sp.Skeleton) ], t.prototype, "skeleton", void 0), a([ p(sp.Skeleton) ], t.prototype, "combine", void 0), 
    a([ p(cc.Node) ], t.prototype, "box", void 0), a([ p(cc.Node) ], t.prototype, "btns", void 0), 
    a([ u ], t);
}(l.default);

n.default = h;